from .request import get, post
import config
from urllib.parse import quote

def login_token(code):
    response = get('index.php/user/get_web_token', { "code": code })
    return response.json()

def get_user():
    response = get('index.php/user/startup')
    return response.json()

def get_auth_url(code):
    return f'{config.AUTH_URL}{quote(code)}'